package com.itheima.mapper;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;

@Mapper
public interface OrderSetMapper {
    /**
     * 查询预约人数
     * @param orderDate
     * @return
     */
    @Select("select * from t_ordersetting where orderDate like concat('%',#{orderDate},'%')")
    OrderSetting list(LocalDate orderDate);

    /**
     * 更新预约人数
     * @param orderDate
     */
    @Update("update t_ordersetting set reservations=reservations+1 where orderDate like concat('%',#{orderDate},'%') ")
    void update(LocalDate orderDate);
}
